#!/bin/bash
# 创建数据目录
MODULE_PATH=/opt/module/fastdfs/tracker
DOCKER_NAME=fastdfs_tracker

# 删除数据目录及窗器
rm -rf $MODULE_PATH
if(( `docker ps -a | grep $DOCKER_NAME | wc -l` >0 ));then
    docker rm -f $DOCKER_NAME
fi

# 启动容器
docker run -d \
    --privileged=true \
    -v /etc/localtime:/etc/localtime:ro \
    -e TZ=Asia/Shanghai \
    --network=host \
    --name $DOCKER_NAME \
    -v $MODULE_PATH:/var/fdfs \
    delron/fastdfs tracker

# 查看状态
docker logs $DOCKER_NAME
# =============================================
# 查看启动参数：如下
# /opt/module/fastdfs/tracker/logs
# =============================================
# [2020-04-11 11:09:10] INFO - FastDFS v5.11
# base_path=/var/fdfs
# run_by_group=
# run_by_user=
# connect_timeout=30s
# network_timeout=60s
# port=22122
# bind_addr=
# max_connections=256
# accept_threads=1
# work_threads=4
# min_buff_size=8192
# max_buff_size=131072
# store_lookup=2
# store_group=
# store_server=0
# store_path=0
# reserved_storage_space=10.00%
# download_server=0
# allow_ip_count=-1
# sync_log_buff_interval=10s
# check_active_interval=120s
# thread_stack_size=64 KB
# storage_ip_changed_auto_adjust=1
# storage_sync_file_max_delay=86400s
# storage_sync_file_max_time=300s
# use_trunk_file=0
# slot_min_size=256
# slot_max_size=16 MB
# trunk_file_size=64 MB
# trunk_create_file_advance=0
# trunk_create_file_time_base=02:00
# trunk_create_file_interval=86400
# trunk_create_file_space_threshold=20 GB
# trunk_init_check_occupying=0
# trunk_init_reload_from_binlog=0
# trunk_compress_binlog_min_interval=0
# use_storage_id=0
# id_type_in_filename=ip
# storage_id_count=0
# rotate_error_log=0
# error_log_rotate_time=00:00
# rotate_error_log_size=0
# log_file_keep_days=0
# store_slave_file_use_link=0
# use_connection_pool=0
# g_connection_pool_max_idle_time=3600s
